{
 "cells": [
  {
   "cell_type": "code",
   "id": "initial_id",
   "metadata": {
    "collapsed": true,
    "ExecuteTime": {
     "end_time": "2025-11-14T09:05:39.924978Z",
     "start_time": "2025-11-14T09:05:39.919575Z"
    }
   },
   "source": [
    "import pandas as pd\n",
    "data_index = pd.to_datetime(['19990421','20090511','20061121'])"
   ],
   "outputs": [],
   "execution_count": 6
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-11-14T09:06:55.057897Z",
     "start_time": "2025-11-14T09:06:55.051379Z"
    }
   },
   "cell_type": "code",
   "source": [
    "date_ser = pd.Series([11,22,33],index=data_index)\n",
    "date_ser"
   ],
   "id": "a255316eb1a5111e",
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1999-04-21    11\n",
       "2009-05-11    22\n",
       "2006-11-21    33\n",
       "dtype: int64"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 8
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-11-14T09:01:58.922445Z",
     "start_time": "2025-11-14T09:01:58.918860Z"
    }
   },
   "cell_type": "code",
   "source": [
    "from datetime import datetime\n",
    "import pandas as pd"
   ],
   "id": "7ee81b9a8848fae8",
   "outputs": [],
   "execution_count": 4
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-11-14T09:07:00.677177Z",
     "start_time": "2025-11-14T09:07:00.669728Z"
    }
   },
   "cell_type": "code",
   "source": [
    "data_demo = [[11,22,33],[44,55,66],\n",
    "             [77,88,99],[12,23,34]]\n",
    "date_list = [datetime(1999,4,21),datetime(2006,11,21),datetime(2025,11,15),datetime(2025,11,16)]\n",
    "time_df = pd.DataFrame(data_demo,index=date_list)\n",
    "time_df"
   ],
   "id": "29129c5ef8c57672",
   "outputs": [
    {
     "data": {
      "text/plain": [
       "             0   1   2\n",
       "1999-04-21  11  22  33\n",
       "2006-11-21  44  55  66\n",
       "2025-11-15  77  88  99\n",
       "2025-11-16  12  23  34"
      ],
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>0</th>\n",
       "      <th>1</th>\n",
       "      <th>2</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>1999-04-21</th>\n",
       "      <td>11</td>\n",
       "      <td>22</td>\n",
       "      <td>33</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2006-11-21</th>\n",
       "      <td>44</td>\n",
       "      <td>55</td>\n",
       "      <td>66</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-11-15</th>\n",
       "      <td>77</td>\n",
       "      <td>88</td>\n",
       "      <td>99</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2025-11-16</th>\n",
       "      <td>12</td>\n",
       "      <td>23</td>\n",
       "      <td>34</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 9
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-11-14T09:18:18.932713Z",
     "start_time": "2025-11-14T09:18:18.929432Z"
    }
   },
   "cell_type": "code",
   "source": [
    "import numpy as np\n",
    "import pandas as pd"
   ],
   "id": "4e9062ebfdd4b8ec",
   "outputs": [],
   "execution_count": 16
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-11-14T09:18:09.770649Z",
     "start_time": "2025-11-14T09:18:09.764079Z"
    }
   },
   "cell_type": "code",
   "source": [
    "date_list = ['2020/05/30', '2022/02/01', '2020/6/1',\n",
    "             '2021/4/1', '2022/6/1', '2023/1/23']\n",
    "date_index = pd.to_datetime(date_list)\n",
    "date_ser = pd.Series(np.arange(6), index=date_index)\n",
    "date_ser"
   ],
   "id": "972b1bf633288fbe",
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2020-05-30    0\n",
       "2022-02-01    1\n",
       "2020-06-01    2\n",
       "2021-04-01    3\n",
       "2022-06-01    4\n",
       "2023-01-23    5\n",
       "dtype: int64"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 15
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
